#pragma once

#include <afx.h>
#include <iostream>
#include <list>
#include <string>
#include <map>

using namespace std;

enum ErrorType {
	ERROR_NONE,
	ERROR_PAREN,
	ERROR_BRACE,
	ERROR_QUOTE,
	ERROR_FILE,
	ERROR_FUNCTION,
	ERROR_INVALID_GLOBAL,
	ERROR_DEFAULT
};

struct sError
{
	sError();
	CString ErrorText;
	int Line;
	ErrorType eType;
	CString File;
};

class CError
{
public:
	CError();
	CError(sError err);
	CError(CString ErrorText, int line, ErrorType et, CString eFile);
	~CError();

	void NewError(CString ErrorText, int line, CString eFile, ErrorType et = ERROR_DEFAULT);
	list<sError> getErrorsByFile(CString fileName);
	list<sError> getErrorsByType(ErrorType eType);

private:
	map<CString,list<sError>> m_ErrorList;

	map<CString,list<sError>>::iterator errorItr;
};